package com.reggie.mapper;

import com.github.pagehelper.Page;
import com.reggie.annotation.AutoFill;
import com.reggie.constant.AutoFillConstant;
import com.reggie.dto.SetmealPageQueryDTO;
import com.reggie.entity.Setmeal;
import com.reggie.vo.SetmealVO;
import org.apache.ibatis.annotations.Mapper;

import java.util.List;
import java.util.Map;

@Mapper
public interface SetmealMapper {
    //根据id查询套餐的数量
    Integer countByCategoryId(Long id);

    //修改套餐的状态
    void updateStatusByIds(Map mapSetmeal);
    
    //新增套餐
    @AutoFill(Type = AutoFillConstant.INSERT)
    void insert(Setmeal setmeal);

    //分页查询
    Page<SetmealVO> pageQuery(SetmealPageQueryDTO setmealPageQueryDTO);

    //根据id查询套餐
    Setmeal getById(Long id);

    //根据id删除套餐
    @AutoFill(Type = AutoFillConstant.UPDATE)
    void deleteById(Long setmealId);

    //根据id查询套餐 ,用于数据回显
    SetmealVO getByIdWithDish(Long id);
    
    //修改套餐 
    @AutoFill(Type = AutoFillConstant.UPDATE)
    void update(Setmeal setmeal);

    void updateStatusById(Integer status, Long id);

    List<Setmeal> list(Setmeal setmeal);

    Integer countByMap(Map map);
}
